<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
div{
    width : 200px;
    height : 200px;
    background-color : pink;
}
</style>
<script src="test.js"></script>
</head>
<body>
<div onclick="javascript:alert('育知同创欢迎你')"></div>

<div id="box"></div>
<script>
var box = document.getElementById("box");
box.onclick = function (){
    alert("你好");
}
</script>


</body>
</html>